﻿using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;
using DeepTalkWF;
using System.Collections.Generic;

namespace DeepTalkRenderService
{
    public sealed partial class DTRenderWF : StateMachineWorkflowActivity
    {
        public DTRenderWF()
        {
            InitializeComponent();
            RenderWFType = typeof(RenderConference);
        }

        public static DependencyProperty agendaXMLProperty = DependencyProperty.Register("agendaXML", typeof(System.String), typeof(DeepTalkRenderService.DTRenderWF));

        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        [BrowsableAttribute(true)]
        [CategoryAttribute("Parameters")]
        public String agendaXML
        {
            get
            {
                return ((string)(base.GetValue(DeepTalkRenderService.DTRenderWF.agendaXMLProperty)));
            }
            set
            {
                base.SetValue(DeepTalkRenderService.DTRenderWF.agendaXMLProperty, value);
            }
        }

        public static DependencyProperty MeetingIDProperty = DependencyProperty.Register("MeetingID", typeof(System.Int32), typeof(DeepTalkRenderService.DTRenderWF));

        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        [BrowsableAttribute(true)]
        [CategoryAttribute("Parameters")]
        public Int32 MeetingID
        {
            get
            {
                return ((int)(base.GetValue(DeepTalkRenderService.DTRenderWF.MeetingIDProperty)));
            }
            set
            {
                base.SetValue(DeepTalkRenderService.DTRenderWF.MeetingIDProperty, value);
            }
        }

        /// <summary>
        /// Hack so we can pass the rendering workflow type to an activity since I don't know how to enter it as an argument in the
        /// property designer.
        /// TODO: We should be able to figure out how to get rid fo this by looking at the designer generated code.
        /// </summary>
        public Type RenderWFType { get; set; }

        public static DependencyProperty RenderWFResultsProperty = DependencyProperty.Register("RenderWFResults", typeof(System.Collections.Generic.Dictionary<System.String, System.Object>), typeof(DeepTalkRenderService.DTRenderWF));

        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        [BrowsableAttribute(true)]
        [CategoryAttribute("Misc")]
        public System.Collections.Generic.Dictionary<String, Object> RenderWFResults
        {
            get
            {
                return ((System.Collections.Generic.Dictionary<string, object>)(base.GetValue(DeepTalkRenderService.DTRenderWF.RenderWFResultsProperty)));
            }
            set
            {
                base.SetValue(DeepTalkRenderService.DTRenderWF.RenderWFResultsProperty, value);
            }
        }

        public static DependencyProperty renderWFArgumentsProperty = DependencyProperty.Register("renderWFArguments", typeof(System.Collections.Generic.Dictionary<System.String, System.Object>), typeof(DeepTalkRenderService.DTRenderWF));

        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        [BrowsableAttribute(true)]
        [CategoryAttribute("Misc")]
        public System.Collections.Generic.Dictionary<String, Object> renderWFArguments
        {
            get
            {
                return ((System.Collections.Generic.Dictionary<string, object>)(base.GetValue(DeepTalkRenderService.DTRenderWF.renderWFArgumentsProperty)));
            }
            set
            {
                base.SetValue(DeepTalkRenderService.DTRenderWF.renderWFArgumentsProperty, value);
            }
        }

        /// <summary>
        /// Called to prep the WF argument list.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CodePrepareWFArguments(object sender, EventArgs e)
        {
            renderWFArguments = new Dictionary<string, object>();
            renderWFArguments["AgendaInfo"] = agendaXML;
            renderWFArguments["TempDirectory"] = TempFilesDirectory;
            renderWFArguments["MeetingOutputDirectory"] = MeetingOutputDirectory;
        }

        public static DependencyProperty TempFilesDirectoryProperty = DependencyProperty.Register("TempFilesDirectory", typeof(System.IO.DirectoryInfo), typeof(DeepTalkRenderService.DTRenderWF));

        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        [BrowsableAttribute(true)]
        [CategoryAttribute("Misc")]
        public System.IO.DirectoryInfo TempFilesDirectory
        {
            get
            {
                return ((System.IO.DirectoryInfo)(base.GetValue(DeepTalkRenderService.DTRenderWF.TempFilesDirectoryProperty)));
            }
            set
            {
                base.SetValue(DeepTalkRenderService.DTRenderWF.TempFilesDirectoryProperty, value);
            }
        }

        public static DependencyProperty MeetingOutputDirectoryProperty = DependencyProperty.Register("MeetingOutputDirectory", typeof(System.IO.DirectoryInfo), typeof(DeepTalkRenderService.DTRenderWF));

        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        [BrowsableAttribute(true)]
        [CategoryAttribute("Parameters")]
        public System.IO.DirectoryInfo MeetingOutputDirectory
        {
            get
            {
                return ((System.IO.DirectoryInfo)(base.GetValue(DeepTalkRenderService.DTRenderWF.MeetingOutputDirectoryProperty)));
            }
            set
            {
                base.SetValue(DeepTalkRenderService.DTRenderWF.MeetingOutputDirectoryProperty, value);
            }
        }
    }
}
